package src; 

import java.awt.Color;

/**
 * Abstract representation of a player, with identifiers color
 * @author Akshat
 *
 */
public abstract class Player 
{
	protected SuperTicTacToeGame game; 
	protected GridLocation playLoc; 
	protected Color color; 
	
	public Player(Color c)
	{
		color = c; 		
		playLoc = null; 
	}
	
	/**
	 * standard procedure to play for any player
	 */
	public void play()
	{
		GridLocation loc = getPlay(); 
		
		game.controller.repaintGUI();
		game.getBoard().placePiece(new GamePiece(color, loc), loc); 
		game.controller.repaintGUI();
		
	}
	
	public Color getColor()
	{
		return color; 
	}
	
	public void setColor( Color c )
	{
		color = c; 
	}
	
	public void setGame( SuperTicTacToeGame g)
	{
		game = g; 
	}
	
	public abstract GridLocation getPlay(); 
	public abstract void setPlay(GridLocation loc); 
	public abstract String toString(); 
	
}
